int ledr = 8;
int ledj = 9;
int incoming = 0;

void setup(){
  Serial.begin(9600);
  pinMode(ledr, OUTPUT);
  pinMode(ledj, OUTPUT);
  digitalWrite(13, HIGH);
}

void loop(){
  if(Serial.available() > 0){
    incoming = Serial.read();
    Serial.flush();
  }
  if(incoming == '1'){
      digitalWrite(ledr, HIGH);
    }
    else digitalWrite(ledr, LOW);

    if(incoming == '2'){
      digitalWrite(ledj, HIGH); 
    }
   else digitalWrite(ledj, LOW);
}
















